<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\common\model;

use think\Model;

class Attr extends Model
{
    public function attrValue()
    {
        return $this->hasMany('AttrValue');
    }

    public static function getAttrList()
    {
        $list = self::with('attrValue')->paginate(20); // with 接收一个数组
        return $list;
    }
    public static function getAttrInfo($id)
    {
        $list = self::with('attrValue')->where('id',$id)->find(); // with 接收一个数组
        return $list;
    }

}